<!--
* description: 索赔倒扣查询/索赔倒扣审核详情
* author: wangjuan
* createdDate:2020-11-12
-->
<template>
  <section class="editSetBelowAdd">
    <el-dialog
      v-dialogDrag
      :visible.sync="curPopupsVisible"
      :title="textMap[popupsState]"
      :append-to-body="true"
      width="70%"
      :close-on-click-modal="false"
      @close="closeEdit"
      @opened="open"
    >
      <dialogHeader
        slot="title"
        :title="textMap[popupsState]"
        :style-type="$store.state.app.dialogType"
      />

      <div class="filter-container filter-title">索赔单信息</div>
      <div class="filter-container filter-params">
        <el-button
          v-show="showFlag"
          class="add"
          type="primary"
          @click="pass"
        >通过</el-button>
        <el-button
          v-show="showFlag"
          class="add"
          type="primary"
          @click="reject"
        >驳回</el-button>

        <el-button
          v-show="isShowFlag"
          class="add"
          type="primary"
        >保存</el-button>
        <el-button
          v-show="isShowFlag"
          class="add"
          type="primary"
        >提交</el-button>
        <el-button
          v-show="isShowFlag"
          class="add"
          type="primary"
        >作废</el-button>
        <el-row ref="vailComponentList1" :gutter="26">
          <!-- <one-table-template
            ref="multipleTable1"
            :dynamic-components="tableComponents1"
            :dynamic-api-config="apiConfig"
            :dynamic-form-fields="formField"
            :dynamic-is-show-select="false"
            :dynamic-is-init-table="true"
            :dynamic-is-show-more-btn="true"
            :callback-obj="callbackObj"
          /> -->
          <component
            :is="comp.component"
            v-for="comp in tableComponents1.filter((o) => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds"
            :code="formField[comp.codeField]"
            :disabled="comp.disabled"
            :o-fields="comp.oFields"
            :options="comp.options"
            :custom-obj="comp.customObj"
            :is-require="comp.isRequire"
            :is-mul="comp.isMul"
            :span="comp.span || 8"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :date-options-type="comp.dateOptionsType"
            @changeCode="getComponentCode"
            @focusCode="getFocusCode"
          />
        </el-row>
      </div>

      <div class="filter-container filter-title">车辆信息</div>
      <div class="filter-container filter-params">
        <el-row :gutter="26">
          <component
            :is="comp.component"
            v-for="comp in tableComponents2.filter((o) => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds"
            :code="formField[comp.codeField]"
            :disabled="comp.disabled"
            :o-fields="comp.oFields"
            :options="comp.options"
            :custom-obj="comp.customObj"
            :is-require="comp.isRequire"
            :is-mul="comp.isMul"
            :span="comp.span || 8"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :date-options-type="comp.dateOptionsType"
            @changeCode="getComponentCode"
            @focusCode="getFocusCode"
          />
        </el-row>
      </div>

      <div class="filter-container filter-title">客户信息</div>
      <div class="filter-container filter-params">
        <el-row ref="vailComponentList2" :gutter="26">
          <component
            :is="comp.component"
            v-for="comp in tableComponents3.filter((o) => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds"
            :code="formField[comp.codeField]"
            :disabled="comp.disabled"
            :o-fields="comp.oFields"
            :options="comp.options"
            :custom-obj="comp.customObj"
            :is-require="comp.isRequire"
            :is-mul="comp.isMul"
            :span="comp.span || 8"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :date-options-type="comp.dateOptionsType"
            @changeCode="getComponentCode"
            @focusCode="getFocusCode"
          />
        </el-row>
      </div>

      <div class="filter-container filter-title">倒扣单信息</div>
      <div class="filter-container filter-params">
        <el-row ref="vailComponentList2" :gutter="26">
          <component
            :is="comp.component"
            v-for="comp in tableComponents4.filter((o) => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds"
            :code="formField[comp.codeField]"
            :disabled="comp.disabled"
            :o-fields="comp.oFields"
            :options="comp.options"
            :custom-obj="comp.customObj"
            :is-require="comp.isRequire"
            :is-mul="comp.isMul"
            :span="comp.span || 8"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :date-options-type="comp.dateOptionsType"
            @changeCode="getComponentCode"
            @focusCode="getFocusCode"
          />
        </el-row>
      </div>

      <div class="filter-container filter-title">其他信息</div>
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="故障信息" name="first">
          <div class="filter-container filter-params">
            <el-row ref="vailComponentList2" :gutter="26">
              <component
                :is="comp.component"
                v-for="comp in tableComponents5.filter(
                  (o) => o.isMust === true
                )"
                :ref="
                  comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey
                "
                :key="comp.compKey"
                :validrule="comp.validrule"
                :code-field="comp.codeField"
                :text-field="comp.textField"
                :popups-key="comp.compKey"
                :parent-fileds="comp.parentFileds"
                :code="formField[comp.codeField]"
                :disabled="comp.disabled"
                :o-fields="comp.oFields"
                :options="comp.options"
                :custom-obj="comp.customObj"
                :is-require="comp.isRequire"
                :is-mul="comp.isMul"
                :span="comp.span || 8"
                :label-name="comp.labelName"
                :lookuptype="comp.lookuptype"
                :date-options-type="comp.dateOptionsType"
                @changeCode="getComponentCode"
                @focusCode="getFocusCode"
              />
            </el-row>
          </div>
        </el-tab-pane>
        <el-tab-pane label="附件信息" name="second">
          <one-table-template
            ref="multipleTable"
            :dynamic-buttons="dynamicTableButtons"
            :dynamic-table-cols="tableCols1"
            :dynamic-api-config="apiConfig"
            :dynamic-form-fields="formField"
            :dynamic-is-init-table="true"
            :dynamic-is-show-select="true"
            :dynamic-is-show-more-btn="true"
            :dynamic-table-defult-height="200"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="索赔项目" name="third">
          <one-table-template
            ref="multipleTable"
            :dynamic-table-cols="tableCols"
            :dynamic-api-config="apiConfig"
            :dynamic-form-fields="formField"
            :dynamic-is-init-table="true"
            :dynamic-is-show-select="false"
            :dynamic-is-show-more-btn="true"
            :dynamic-table-defult-height="200"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="索赔备件" name="fourth">
          <one-table-template
            ref="multipleTable"
            :dynamic-table-cols="tableCols2"
            :dynamic-api-config="apiConfig"
            :dynamic-form-fields="formField"
            :dynamic-is-init-table="true"
            :dynamic-is-show-select="false"
            :dynamic-is-show-more-btn="true"
            :dynamic-table-defult-height="200"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="索赔其他项目" name="fiveth">
          <one-table-template
            ref="multipleTable"
            :dynamic-table-cols="tableCols3"
            :dynamic-api-config="apiConfig"
            :dynamic-form-fields="formField"
            :dynamic-is-init-table="true"
            :dynamic-is-show-select="false"
            :dynamic-is-show-more-btn="true"
            :dynamic-table-defult-height="200"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="审核信息" name="sixth">
          <one-table-template
            ref="multipleTable4"
            :dynamic-table-cols="tableCols4"
            :dynamic-api-config="apiConfig"
            :dynamic-form-fields="formField"
            :dynamic-is-init-table="true"
            :dynamic-is-show-select="false"
            :dynamic-is-show-more-btn="true"
            :dynamic-table-defult-height="200"
            :is-show-pagination="false"
          />
        </el-tab-pane>
      </el-tabs>
    </el-dialog>
    <!-- 审核意见弹框 -->
    <el-dialog
      v-dialogDrag
      :visible.sync="dialogFormVisible"
      title="审核意见"
      :append-to-body="true"
      width="30%"
      :close-on-click-modal="false"
      @close="close"
      @opened="open"
    >
      <dialogHeader
        slot="title"
        title="审核意见"
        :style-type="$store.state.app.dialogType"
      />
      <one-table-template
        ref="multipleTable"
        :dynamic-buttons="tableButtons"
        :dynamic-components="tableComponents6"
        :dynamic-form-fields="formField1"
        :dynamic-is-init-table="true"
        :dynamic-is-show-select="false"
        :dynamic-is-show-more-btn="true"
        :dynamic-table-defult-height="200"
        :is-show-pagination="false"
      />
    </el-dialog>
  </section>
</template>
<script>
import { oneTableWithViewTemplateMixins } from '@/components/mixins/oneTableWithViewTemplateMixins'
import { formMixins } from '@/components/mixins/formMixins'
import OneTableTemplate from '@/components/templates/oneTable'
import { vehiclePdiPriceInquirys } from '@/api/se/vehiclePdiPriceInquiry'

export default {
  components: {
    dialogHeader: () => import('@/components/dialogHeader'),
    OneTableTemplate
  },
  // 组件混入对象：{data[listQuery] methods[queryTable]}
  mixins: [oneTableWithViewTemplateMixins, formMixins],

  // // 阻塞路由预加载网格中组件的数据
  // beforeRouteEnter(to, from, next) {
  //   Vue.prototype.$ConfigCache.CacheConfig.initData([to.path, ""], function () {
  //     next();
  //   });
  // },

  props: {
    dynamicEditRowData: {
      type: Object,
      default: () => {
        return {}
      }
    },
    // 弹出是否显示
    popupsVisible: { type: Boolean, default: false },
    customObj: {
      type: Object,
      default: () => {
        return {}
      }
    }
  },

  data() {
    // 页面标识（与上面beforeRouteEnter中的对应）
    const viewPageCode = this.$route.path
    // 绑定事件配置化事件
    this.$ConfigCache.CacheConfig.bindEvent(this, [viewPageCode])
    return {
      // multable: "multipleTable1",
      showBtn: '1', // 开关
      deleteTransferOrderDId: [],
      updateControlIdD: [],
      dataRefs: ['truecompKey2', 'truecompKey3'],
      showFlag: false, // 倒扣审核页面
      isShowFlag: false, // 倒扣申请页面
      dialogFormVisible: false, // 审核意见弹框
      // apiConfig: vehiclePdiPriceInquirys.findClaimDetail,
      // 动态组件-按钮
      dynamicTableButtons: [
        {
          compKey: 'btnKey1',
          type: 'primary',
          size: 'small',
          name: 'preservation',
          // clickEvent: () => this.addRow(),
          text: '下载',
          isShow: true
        }
      ],
      tableComponents:
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode] &&
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode].formComponents
          .length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[viewPageCode].formComponents
          : [],
      // 动态组件-查询条件
      tableComponents1:
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode] &&
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode].formComponents
          .length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[viewPageCode].formComponents
          : [
            {
              compKey: 'compKey1',
              labelName: '门店编号：',
              codeField: 'dlrCode',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey2',
              labelName: '门店名称：',
              codeField: 'dlrFullName',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey4',
              labelName: '索赔单号:',
              codeField: 'claimCode',
              // component: () => import("@/components/ve/multipleSearchInput"),
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              isMust: true,
              disabled: true,
              span: 6
            },
            {
              compKey: 'compKey4',
              labelName: '单据状态：',
              codeField: 'claimStatus',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey5',
              labelName: '索赔员：',
              codeField: 'claimId',
              textField: 'cityName',
              oFields: 'cityId,cityName',
              customObj: {
                // api: apis.listOfCities,
                selectType: '1'
              },
              component: () => import('@/components/org/commonSelect'),
              type: 'dropdownList',
              isMust: true,
              disabled: true,
              span: 6
            },
            {
              compKey: 'compKey6',
              labelName: '索赔员电话：',
              codeField: 'linkManTel',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey7',
              labelName: '索赔分类：',
              codeField: 'claimTypeName',
              textField: 'cityName',
              oFields: 'cityId,cityName',
              customObj: {
                // api: apis.listOfCities,
                selectType: '1'
              },
              component: () => import('@/components/org/commonSelect'),
              type: 'dropdownList',
              isMust: true,
              disabled: true,
              span: 6
            },
            {
              compKey: 'compKey8',
              labelName: '活动编号：',
              codeField: 'actionCode',
              textField: 'cityName',
              oFields: 'cityId,cityName',
              customObj: {
                // api: apis.listOfCities,
                selectType: '1'
              },
              component: () => import('@/components/org/commonSelect'),
              type: 'dropdownList',
              isMust: true,
              disabled: true,
              span: 6
            },
            {
              compKey: 'compKey9',
              labelName: '索赔月份：',
              codeField: 'claimMonth',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey10',
              labelName: '提交日期：',
              codeField: 'submitDate',
              component: () =>
                import('@/components/org/datePicker/datePicker.vue'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey11',
              labelName: '运输费：',
              codeField: 'shipAmount',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey12',
              labelName: '补偿意外费：',
              codeField: 'compAmount',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey13',
              labelName: '工时费：',
              codeField: 'wiAmount',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey14',
              labelName: '备件费：',
              codeField: 'partAmount',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey15',
              labelName: '其他费用：',
              codeField: 'sumOtherAmount',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey16',
              labelName: '总金额：',
              codeField: 'sumAmount',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            }
          ],

      // 动态组件-查询条件
      tableComponents2:
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode] &&
        this.$ConfigCache.CacheConfig.cacheData[viewPageCode].formComponents
          .length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[viewPageCode].formComponents
          : [
            {
              compKey: 'compKey1',
              labelName: '派单工号：',
              codeField: 'repairOrderCode',
              textField: 'dlrFullName',
              component: () => import('@/components/org/commonInput'),
              // component: () => import("@/components/ve/salesStore"),
              type: 'inputText',
              disabled: true,
              isMust: true,
              isMul: false,
              span: 6
            },
            {
              compKey: 'compKey2',
              labelName: '车牌号：',
              codeField: 'carLicense',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey3',
              labelName: '车型：',
              codeField: 'carConfigCN',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey4',
              labelName: '进厂时间：',
              codeField: 'repairDate',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey5',
              labelName: '保修开始时间：',
              codeField: 'invoiceDate',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey6',
              labelName: '行驶里程：',
              codeField: 'mileage',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey7',
              labelName: '购件里程：',
              codeField: 'payMileage',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey8',
              labelName: '购件日期：',
              codeField: 'payDate',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey9',
              labelName: '保修申请单号：',
              codeField: 'preAuthorCode',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey10',
              labelName: 'VIN码：',
              codeField: 'VIN',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey11',
              labelName: '车辆用途：',
              codeField: 'buyCaruseCodeName',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey12',
              labelName: '生产日期：',
              codeField: 'produceDate',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey13',
              labelName: '前电机号：',
              codeField: 'engineCode',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey14',
              labelName: '后电机号：',
              codeField: 'engineCode2',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey15',
              labelName: '底盘号：',
              codeField: 'underpanNO',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            },
            {
              compKey: 'compKey16',
              labelName: '变速箱号：',
              codeField: 'ectCode',
              component: () => import('@/components/org/commonInput'),
              type: 'inputText',
              disabled: true,
              isMul: false,
              isMust: true,
              span: 6
            }
          ],

      tableComponents3: [
        {
          compKey: 'compKey1',
          labelName: '车主姓名：',
          codeField: 'custName',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey2',
          labelName: '性别：',
          codeField: 'gender',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey3',
          labelName: '车主手机：',
          codeField: 'phone',
          validrule: { isPhone: true, maxlength: 11 },
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey4',
          labelName: '省份：',
          codeField: 'addrPrivince',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey5',
          labelName: '城市：',
          codeField: 'addrCity',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey6',
          labelName: '区县：',
          codeField: 'addrCounty',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey7',
          labelName: '街道地址：',
          codeField: 'addrStreet',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 12
        },
        {
          compKey: 'compKey8',
          labelName: '送修人：',
          codeField: 'linkMan',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey9',
          labelName: '送修人电话：',
          codeField: 'linkManTels',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        }
      ],

      tableComponents4: [
        {
          compKey: 'compKey1',
          labelName: '倒扣单号：',
          codeField: 'reverseCode',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey2',
          labelName: '倒扣状态：',
          codeField: 'reverseStatus',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey3',
          labelName: '已扣金额：',
          codeField: 'buckledAmount',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey4',
          labelName: '待扣金额：',
          codeField: 'yetAmount',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey5',
          labelName: '倒扣金额：',
          codeField: 'reverseAmount',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey6',
          labelName: '倒扣原因：',
          codeField: 'reason',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 18
        }
      ],

      tableComponents5: [
        {
          compKey: 'compKey',
          labelName: '故障类型：',
          codeField: 'custType',
          textField: 'cityName',
          oFields: 'cityId,cityName',
          customObj: {
            // api: apis.listOfCities,
            selectType: '1'
          },
          component: () => import('@/components/org/commonSelect'),
          type: 'dropdownList',
          isMust: true,
          disabled: true,
          span: 6
        },
        {
          compKey: 'compKey2',
          labelName: '故障件代码：',
          codeField: 'pfpCode',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey3',
          labelName: '故障件名称：',
          codeField: 'pfpName',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey4',
          labelName: '故障件日期：',
          codeField: 'faultTime',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey5',
          labelName: '故障现象码：',
          codeField: 'csCode',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        // {
        //   compKey: "compKey6",
        //   labelName: "故障原因码：",
        //   codeField: "",
        //   component: () => import("@/components/org/commonInput"),
        //   type: "inputText",
        //   disabled: true,
        //   isMul: false,
        //   isMust: true,
        //   span: 6,
        // },
        {
          compKey: 'compKey7',
          labelName: '故障部位：',
          codeField: 'faultPartCode',
          textField: 'cityName',
          oFields: 'cityId,cityName',
          customObj: {
            // api: apis.listOfCities,
            selectType: '1'
          },
          component: () => import('@/components/org/commonSelect'),
          type: 'dropdownList',
          isMust: true,
          disabled: true,
          span: 6
        },
        {
          compKey: 'compKey8',
          labelName: '故障数据：',
          codeField: 'faultDTC',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMul: false,
          isMust: true,
          span: 6
        },
        {
          compKey: 'compKey9',
          labelName: '备注：',
          codeField: 'remark',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMust: true,
          span: 24
        },
        {
          compKey: 'compKey10',
          labelName: '故障描述：',
          codeField: 'custComplainCS',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMust: true,
          span: 24
        },
        {
          compKey: 'compKey11',
          labelName: '诊断过程：',
          codeField: 'detailCheckSynopsis',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMust: true,
          span: 24
        },
        {
          compKey: 'compKey12',
          labelName: '故障处理：',
          codeField: 'repairWay',
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          disabled: true,
          isMust: true,
          span: 24
        }
      ],

      tableCols: [
        {
          prop: 'releaseId',
          label: '主键ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'updateControlIdO',
          label: '并发控制ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'updateControlIdOd',
          label: '并发控制ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'transferOrderId',
          label: '展车主单id',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'transferOrderDId',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'wiCode',
          label: '工时编码',
          align: 'center'
        },
        {
          prop: 'wiName',
          label: '维修内容',
          align: 'center'
        },
        {
          prop: 'wiQTY',
          label: '工时数',
          align: 'center'
        },
        {
          prop: 'wiPrice',
          label: '工时单价',
          align: 'center'
        },
        {
          prop: 'wiTotal',
          label: '费用合计',
          align: 'center'
        },
        {
          prop: 'claimWiCoef',
          label: '索赔系数',
          align: 'center'
        },
        {
          prop: 'isMain',
          label: '是否主工时',
          align: 'center'
        },
        {
          prop: 'remark2',
          label: '备注',
          align: 'center'
        }
      ],

      tableCols1: [
        {
          prop: 'releaseId',
          label: '主键ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'updateControlIdO',
          label: '并发控制ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'updateControlIdOd',
          label: '并发控制ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'transferOrderId',
          label: '展车主单id',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'transferOrderDId',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'fileName',
          label: '附件名称',
          align: 'center'
        },
        {
          prop: '',
          label: '备注',
          align: 'center'
        }
      ],

      tableCols2: [
        {
          prop: 'releaseId',
          label: '主键ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'updateControlIdO',
          label: '并发控制ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'updateControlIdOd',
          label: '并发控制ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'transferOrderId',
          label: '展车主单id',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'transferOrderDId',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'partCode',
          label: '备件编码',
          align: 'center'
        },
        {
          prop: 'partName',
          label: '备件名称',
          align: 'center'
        },
        {
          prop: 'partQTY',
          label: '数量',
          align: 'center'
        },
        {
          prop: 'partPrice',
          label: '单价',
          align: 'center'
        },
        {
          prop: 'partSum',
          label: '费用合计',
          align: 'center'
        },
        {
          prop: 'partClaimWiCoef',
          label: '索赔系数',
          align: 'center'
        },
        {
          prop: 'partIsMain',
          label: '是否主备件',
          align: 'center'
        },
        {
          prop: 'partRemark',
          label: '备件',
          align: 'center'
        }
      ],

      tableCols3: [
        {
          prop: 'releaseId',
          label: '主键ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'updateControlIdO',
          label: '并发控制ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'updateControlIdOd',
          label: '并发控制ID',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'transferOrderId',
          label: '展车主单id',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'transferOrderDId',
          hidden: true,
          alwaysHidden: true
        },
        {
          prop: 'otherFeeName',
          label: '其他项目',
          align: 'center'
        },
        {
          prop: 'otherFee',
          label: '费用',
          align: 'center'
        },
        {
          prop: 'otherRemark',
          label: '备注',
          align: 'center'
        }
      ],

      tableCols4:
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path] &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols4 &&
        this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols4
          .length > 0
          ? this.$ConfigCache.CacheConfig.cacheData[this.$route.path].tableCols4
          : [
            {
              prop: 'releaseId',
              label: '主键ID',
              hidden: true,
              alwaysHidden: true
            },
            {
              prop: 'updateControlIdO',
              label: '并发控制ID',
              hidden: true,
              alwaysHidden: true
            },
            {
              prop: 'updateControlIdOd',
              label: '并发控制ID',
              hidden: true,
              alwaysHidden: true
            },
            {
              prop: 'transferOrderId',
              label: '展车主单id',
              hidden: true,
              alwaysHidden: true
            },
            {
              prop: 'transferOrderDId',
              hidden: true,
              alwaysHidden: true
            },
            {
              prop: 'appealStatus',
              label: '审核结果',
              align: 'center'
            },
            {
              prop: 'auditMemo',
              label: '审核意见',
              align: 'center'
            },
            {
              prop: 'auditUser',
              label: '审核人',
              align: 'center'
            },
            {
              prop: 'auditDate',
              label: '审核时间',
              align: 'center'
            },
            {
              prop: 'auditRemark',
              label: '备注',
              align: 'center'
            }
          ],
      formField: {
        claimCode: '', // 索赔单
        reverseCode: '' // 倒扣单
      },

      // 审核意见
      tableComponents6: [
        {
          compKey: 'compKey8',
          labelName: '审核意见：',
          codeField: 'auditMemo',
          component: () => import('@/components/org/commonInput/textareaInput'),
          type: 'dropdownList',
          isMust: true,
          span: 24
        }
      ],
      tableButtons: [
        {
          compKey: 'btnKey1',
          type: 'primary',
          size: 'small',
          icon: 'iconfont  icon-preservation',
          clickEvent: () => this.save(),
          text: this.$t('sys.button.save') /* 保存*/,
          position: 'right'
        },
        {
          compKey: 'btnKey2',
          type: '',
          size: 'small',
          icon: 'iconfont  icon-cancel',
          clickEvent: () => this.close(),
          text: this.$t('sys.button.cancel') // 取消
        }
      ],
      formField1: {
        auditMemo: '',
        dkSubmit: 1,
        status: false
      },
      // 标题
      textMap: {
        edit: '查看索赔倒扣详情',
        audit: '查看索赔倒扣详情'
      },
      activeName: 'first', // tab栏默认项
      dataList: [],
      cIndex: 0
    }
  },
  watch: {
    // "formField.cityId": {
    //   handler: function (val) {
    //     // debugger
    //     if (val) {
    //       this.$requestAPI({
    //         apiUrl: api.ListOfDeliveryStoreContent.APIUrl,
    //         variables: { cityId: val },
    //       }).then((response) => {
    //         if (response.result === "1") {
    //           const rowData = response.rows[0];
    //           this.formField.deliveryDlrId = rowData.deliveryDlrId;
    //           this.formField.deliveryDlrFullName = rowData.deliveryDlrFullName;
    //         }
    //       });
    //     }
    //   },
    // },
    curPopupsVisible(val) {}
  },
  created() {
    this.tableComponents = [
      ...this.tableComponents1,
      ...this.tableComponents2,
      ...this.tableComponents3,
      ...this.tableComponents4,
      ...this.tableComponents5
    ]
  },

  mounted() {
    this.$nextTick(() => {
      this.formField = Object.assign(this.formField, this.dynamicEditRowData)
      if (this.popupsState === 'edit') {
        this.$refs.multipleTable.queryTable(1)
      }
    })
  },

  methods: {
    // 清除验证
    resetOrderIcon() {
      this.$nextTick(() => {
        for (const comp in this.$refs) {
          if (comp.includes('true')) {
            this.$refs[comp][0].$children[0].$children[2].iconV = '3'
          }
        }
      })
    },
    handleClick(tab, event) {
      console.log(tab, event)
    },
    closeEdit() {
      this.resetOrderIcon()
      this.$emit('update:popupsVisible', false)
      this.$emit('close', false)
    },
    close() {
      this.$emit('update:dialogFormVisible', false)
      this.dialogFormVisible = false
      // this.$emit("close", false);
    },
    open() {
      if (this.popupsState == 'edit' || this.popupsState == 'audit') {
        const queryObj = {
          type: 'mutation',
          apiConfig: vehiclePdiPriceInquirys.findClaimDetail,
          variables: {
            claimCode: this.dynamicEditRowData.claimCode,
            reverseCode: this.dynamicEditRowData.reverseCode
          }
        }
        var paramD = this.$getParams(queryObj)
        this.$requestAPI(paramD).then((response) => {
          this.formField = response.rows[0]
          const data = response.rows[0]
          this.$refs.multipleTable4.list = data.auditInfo
        })
      }
      // 倒扣审核页面的按钮显示
      if (this.popupsState == 'audit') {
        this.showFlag = true
      }
      // 倒扣申请页面的按钮显示
      if (this.popupsState == 'apply') {
        this.isShowFlag = true
      }
    },
    pass() {
      this.dialogFormVisible = true
      this.formField1.status = false // false通过 true驳回
    },
    reject() {
      this.dialogFormVisible = true
      this.formField1.status = true // 驳回标识
    },
    // 保存
    save() {
      if (this.formField1.status == true) {
        this.formField1.dkSubmit = 2 // 2驳回 1通过
      } else {
        this.formField1.dkSubmit = 1
      }
      const queryObj = {
        // 保存mutation
        type: 'mutation',
        // api配置
        apiConfig: {
          ServiceCode: 'claimDeductInforAudit',
          APIUrl:
            '/mp/e3sh/aftersale/ClaimDeductApplyService/claimDeductInforAudit.do'
        },
        // 条件/实体参数（变量），根据typeParam中的定义配置
        variables: {
          auditMemo: this.formField1.auditMemo,
          dkSubmit: this.formField1.dkSubmit,
          reverseCode: this.dynamicEditRowData.reverseCode
        }
      }
      // 转换了中台请求格式数据
      var paramD = this.$getParams(queryObj)
      // 调用中台API方法（可复用）
      this.$requestAPI(paramD).then((response) => {
        if (response.result == '1') {
          this.$message({
            message: this.$t('sys.tips.esTip5') /* 保存成功*/,
            type: 'success',
            duration: 1000
          })
          this.dialogFormVisible = false
          this.formField1.auditMemo = ''
          this.curPopupsVisible = false
          this.$nextTick(() => {
            this.$parent.queryTable(1)
          })
        } else {
          // 保存失败
          this.$message({
            message: '保存失败:' + response.msg,
            type: 'warn',
            uration: 1000
          })
        }
        this.dialogFormVisible = false
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.filter-title {
  font-size: 18px;
  font-weight: bolder;
}
.filter-container.filter-title::before {
  border-left: 4px solid #0075ff;
  padding-right: 10px;
  height: 20px;
  left: 0px;
  top: 4px;
}

.btns-container {
  width: 100%;
  height: 30px;
  padding: 0 20px;
  background-color: #fff;
  .el-button {
    float: right;
  }
}
.add {
  margin-right: 19px;
  margin-bottom: 15px;
}
</style>
